<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>盒子模型之外边距margin</title>
    <style>  
    div {
         width:200px;
         height: 200px;
         background-color: aqua;
         /* 外边距可以让块级盒子水平居中,但是要满足两个条件：1.盒子必须指定了宽度（width）,2 盒子左右的外边距都设置为auto */
         margin: 0 auto;
    }
    /* .one{
        margin-bottom: 20px;
    } */
    .two{
        margin-top: 20px;
    }
    </style>
  
</head>
<body>
    <div class="one">1</div>
    <div class="two">2</div>
</body>
</html>